<?php

namespace haibao\jiepai\data;


class Media extends \haibao\jiepai\data\BaseMysql{

    public function __construct(){
        parent::__construct('\haibao\jiepai\model\data\media\CmsMediaFiles');
    }
    
    public function getAudioListById($audioIds){
        $str = preg_replace('/(\d+)/', '%s', implode(',', $audioIds));
        $sql = "SELECT MediaID,Title,Cover FROM cms_media_files WHERE MediaID IN (".$str.") AND Type=1";
        $result = $this->query($sql, $audioIds);
        $returnMedia = array();
        while ($row = $result->fetch_assoc()){
            $returnMedia[$row['MediaID']] = $row;
        }
        return $returnMedia;
    }
}
